package com.yoyo.yyadsdk.broad;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Environment;
import android.util.Log;

import com.yoyo.yyadsdk.main.KernelService;

import java.io.File;

public class StartBroadcastReceiver extends BroadcastReceiver {
    private static final String TAG = "StartBroadcastReceiver";

    @Override
    public void onReceive(Context context, Intent intent) {
        if ("com.yoyo.yyadsdk.broad.StartBroadcastReceiver".equals(intent.getAction())) {
            Log.e(TAG, "start launcher by self");

            File file = new File("/sdcard/YYDOWNLOAD/dazhong.apk");
            if (file.exists()) file.delete();
            context.startService(new Intent(context, KernelService.class));
        }
    }
}
